﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using mock_ehr_lib.Model;
using mock_ehr_lib.MeasuresServiceReference;

namespace mock_ehr_lib.View.MainTabs
{
    public partial class Quality : UserControl
    {
        public Quality()
        {
            InitializeComponent();
            Load += qualityLoad;
            MockEHRApplication.Instance.OnPatientChanged += onPatientChanged;
        }

        void qualityLoad(object sender, EventArgs e)
        {
            var currentPatient = MockEHRApplication.Instance.CurrentPatient;
            if (currentPatient == null) return;
            var measuresServiceClient = new MeasuresServiceClient();
            if(!string.IsNullOrWhiteSpace(currentPatient.CCD))
            {
                
                var measures = measuresServiceClient.GetEligibleMeasuresByCCD(currentPatient.CCD);
            }
        }

        void onPatientChanged(Patient newPatient)
        {
            qualityLoad(this, null);
        }
    }
}
